import request from '@/utils/request';
import settings from '../../../config/defaultSettings';
export async function getOrganizationByPage(params: any) {
  return request(`${settings.prefixUrl}/system/org/getOrganizationByPage`, {
    method: 'POST',
    data: params,
  });
}

export async function addOrganization(params: any) {
  return request(`${settings.prefixUrl}/system/org/addOrganization`, {
    method: 'POST',
    data: params,
  });
}

export async function updateOrganization(params: any) {
  return request(`${settings.prefixUrl}/system/org/updateOrganization`, {
    method: 'POST',
    data: params,
  });
}

export async function delOrganization(params: any) {
  return request(`${settings.prefixUrl}/system/org/delOrganization`, {
    method: 'POST',
    data: params,
  });
}

export async function exportOrganization(params: any) {
  return request(`${settings.prefixUrl}/system/org/exportOrganization`, {
    method: 'POST',
    data: params,
    responseType: 'blob',
  });
}
export async function getOrgTree() {
  return request(`${settings.prefixUrl}/system/org/getOrgTree`, {
    method: 'POST',
  });
}

export default {
  getOrganizationByPage,
  addOrganization,
  updateOrganization,
  delOrganization,
  exportOrganization,
  getOrgTree,
};
